from torch.utils.tensorboard import SummaryWriter
from PIL import Image
import numpy as np

writer = SummaryWriter('logs')
image_path = "dataset/train/ants/9715481_b3cb4114ff.jpg"
image_PIL = Image.open(image_path)
print(type(image_PIL))
image_array = np.array(image_PIL)
print(type(image_array))
print(image_array.shape)
writer.add_image("test", image_array, 1, dataformats="HWC")
# y=2x
for i in range(100):
    writer.add_scalar('y=3x', 3 * i, i)
writer.close()
